
import {Form, Input, Button, } from 'antd';
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
import {inject, observer} from "mobx-react";
import {toJS} from 'mobx';
import ExchangePage from "../common/relateExchange" 
import TabDiscuss from '../common/TabDiscuss'
const getLabel = WeaLocaleProvider.getLabel;

@observer
class ExchangeDialog extends React.Component {
  constructor(props) {
    super(props);
    this.state={
        visible:false
    }
  }
  componentDidMount(){
  }
  componentWillReceiveProps(nextProps) {
 
  }
  
  render() {
    const {contentStore} = this.props;
    const {type,visible,title,targetid,handleExchangeDialog} = contentStore;
    return (
        <div>
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@127oxj`}
                title={title}
                visible={visible}
                buttons={this.getButtons()}
                icon="icon-coms-project"
                iconBgcolor="#217346"
                onCancel={()=>{handleExchangeDialog(false)}}
                style={{width:'900px', height:'600px'}}
            >
                    <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@54ra5z`} height={"100%"}>
                       {/* <ExchangePage contentStore ={contentStore} callBack={()=>{this.reloadExchanges()}} key={new Date().getTime()} /> */}
                       <TabDiscuss ecId={`${this && this.props && this.props.ecId || ''}_TabDiscuss@wj46e4`} contentStore={contentStore} sortid={targetid}/>
                    </WeaNewScroll>
            </WeaDialog>
           
        </div>)
    }
    
    getButtons(){
        const {contentStore,} = this.props;
        let btnArr = []; 
        btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@59g6sq@close`}  type="primary" onClick={()=>contentStore.handleExchangeDialog(false)}>{getLabel(309,"关闭")}</Button>)  
        return btnArr;
    }
}

export default ExchangeDialog;